package com.gamesnet.ihm;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TabHost.TabSpec;

import com.gamesnet.util.TabColors;
import com.gamesnet.widget.ActionBar;
import com.gamesnet.widget.ActionBar.IntentAction;

public class FriendsActivity extends TabActivity implements OnTabChangeListener{
	
private TabHost tabs;
	
	public void onCreate(Bundle savedInstanceState) { 
		
		super.onCreate(savedInstanceState); 
		setContentView(R.layout.friends);
		
		final ActionBar actionBar = (ActionBar) findViewById(R.id.actionbarHaut);
		actionBar.setHomeAction(new IntentAction(this, new Intent(this, DashboardActivity.class), R.drawable.home));
		actionBar.setTitre(PageTitle.FRIENDS);
		
		tabs = getTabHost();
		tabs.setOnTabChangedListener(this);
		
		
		tabs = getTabHost();
		tabs.setOnTabChangedListener(this);
		
		TabSpec tspec1 = tabs.newTabSpec("MyFriends"); 
		tspec1.setIndicator("Mes Amis");
		tspec1.setContent(new Intent(this, MyFriendsActivity.class));
		tabs.addTab(tspec1);

		TabSpec tspec2 = tabs.newTabSpec("SuggestFriends"); 
		tspec2.setIndicator("Suggestion d'amis"); 
		tspec2.setContent(new Intent(this, SuggestFriendsActivity.class));
		tabs.addTab(tspec2);
		
		tabs.setCurrentTab(0);
		TabColors.setUpTabColors(tabs);
		
		
		
	}
	
	public void onTabChanged(String tabId) {
		TabColors.setUpTabColors(tabs);
	}


}
